Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ResponseActions): Add click state #382

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rebeccaalpert
Copy link
Member

@rebeccaalpert rebeccaalpert commented Dec 12, 2024

Add click state to response actions block. The last currently selected item will remain selected until you click someone else on the screen. Clients can also pass in custom tooltips or aria labels based on the clicked state.

Docs:

I've been working directly with Kayla on these already - she has seen them.

@patternfly-build
Copy link

patternfly-build commented Dec 12, 2024

@rebeccaalpert rebeccaalpert linked an issue Dec 12, 2024 that may be closed by this pull request
@rebeccaalpert rebeccaalpert force-pushed the response-action-clicked branch 3 times, most recently from d39d4ea to ef0b576 Compare December 13, 2024 14:41
@@ -79,7 +79,7 @@ You can add actions to a message, to allow users to interact with the message co

### Custom message actions

Beyond the standard message actions (positive, negative, copy, share, or listen), you can add custom actions to a bot message by passing an `actions` object to the `<Message>` component. This object can contain the following customizations: `ariaLabel`, `onClick`, `className`, `isDisabled`, `tooltipContent`, `tooltipProps`, and `icon`.
Beyond the standard message actions (positive, negative, copy, share, or listen), you can add custom actions to a bot message by passing an `actions` object to the `<Message>` component. This object can contain the following customizations: `ariaLabel`, `clickedAriaLabel`, `onClick`, `className`, `isDisabled`, `tooltipContent`, `tooltipContent`, `tooltipProps`, and `icon`. `clickedAriaLabel` and `clickedTooltipContent` are applied only when a button is clicked. If `clickedAriaLabel` or `clickedTooltipContent` are omitted, they will default to the `ariaLabel` or `tooltipContent` supplied.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Beyond the standard message actions (positive, negative, copy, share, or listen), you can add custom actions to a bot message by passing an `actions` object to the `<Message>` component. This object can contain the following customizations: `ariaLabel`, `clickedAriaLabel`, `onClick`, `className`, `isDisabled`, `tooltipContent`, `tooltipContent`, `tooltipProps`, and `icon`. `clickedAriaLabel` and `clickedTooltipContent` are applied only when a button is clicked. If `clickedAriaLabel` or `clickedTooltipContent` are omitted, they will default to the `ariaLabel` or `tooltipContent` supplied.
Beyond the standard message actions (good response, bad response, copy, share, or listen), you can add custom actions to a bot message by passing an `actions` object to the `<Message>` component. This object can contain the following customizations:
- `ariaLabel`
- `onClick`
- `className`
- `isDisabled`
- `tooltipContent`
- `tooltipContent`
- `tooltipProps`
- `icon`
You can apply a `clickedAriaLabel` and `clickedTooltipContent` once a button is clicked. If either of these props are omitted, their values will default to the `ariaLabel` or `tooltipContent` supplied.

do you think changing this to a list is more digestible?

Another idea is to remove the list of props and just link to the props table, since there's more context for each of these props down there? I think I lean to this solution if you think it's okay, but I'll let you choose between the 2!

Beyond the standard message actions (good response, bad response, copy, share, or listen), you can add custom actions to a bot message via the actions object props.

You can apply a clickedAriaLabel and clickedTooltipContent once a button is clicked. If either of these props are omitted, their values will default to the ariaLabel or tooltipContent supplied.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to do option 2, but we have a problem with the docs framework right now where if you click an anchor link, it doesn't take you there, and I hate it. If it's ok with you, I'll go with the first one for now and we can totally change it later.

rebeccaalpert and others added 2 commits December 13, 2024 12:24
Add click state to response actions block. The last currently selected item will remain selected. Clients can also pass in custom tooltips or aria labels based on the clicked state.
…mples/Messages/Messages.md

Co-authored-by: Erin Donehoo <105813956+edonehoo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Track internal clicked state of response actions
3 participants